<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .s1 {
            color: red;
        }

        .s2 {
            color: green;

        }

        .s3 {
            color: blue;
        }
    </style>
</head>

<body>
    <div>
        
    </div>
    <script src="js/jquery-3.5.1.min.js"></script>
    <script>
        var arr = [{
            name: '小谢',
            age: 17,
            sex: '男'
        },
        {
            name: '小谢',
            age: 18,
            sex: '男'
        },
        {
            name: '小谢',
            age: 19,
            sex: '男'
        },{
            name: '小谢',
            age: 20,
            sex: '男'
        }];

        for (var i = 0; i < arr.length; i++) {
            var str = `<span class="s1">${arr[i].name}</span>
        <span class="s2">${arr[i].age}</span>
        <span class="s3">${arr[i].sex}</span><br>`
            console.log(str);
            $('div').append($(str))
        }
    </script>
</body>

</html>